package net.lab1024.sa.base.module.support.elasticsearch.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "elasticsearch")
public class ElasticsearchProperties {
    
    /**
     * 索引前缀
     */
    private String indexPrefix = "";
    
    /**
     * 默认索引模式
     */
    private String defaultIndexPattern = "event-base-*";
    
    /**
     * 获取完整的索引名称
     */
    public String getFullIndexName(String indexName) {
        return indexPrefix + (indexName != null ? indexName : defaultIndexPattern);
    }
} 